package org.example.spring.xmlTx;

//掌握操作的业务层
public class AccountService {
    //注入dao
    private AccountDAO accountDAO;

    public void setAccountDAO(AccountDAO accountDAO) {
        this.accountDAO = accountDAO;
    }

    //转账操作的业务逻辑
    public void transfer(String outName, String inName, Double money) {

        System.out.println("转账开始了");
        //先转出,再转入
        accountDAO.out(outName, money);

        //异常
//        int i=1/0;

        accountDAO.in(inName, money);
        System.out.println("转账结束了");

    }

}
